﻿using System;

namespace FscNET.Apm
{
    /// <summary>
    /// This class contains data useful when suspending/resuming an iterator.
    /// </summary>
    [DebuggerStepThrough]
    public sealed class SuspendResumeArgs
    {
        private readonly AsyncEnumerator m_asyncEnumerator;
        private Object m_state;
        internal SuspendResumeArgs(AsyncEnumerator ae)
        {
            m_asyncEnumerator = ae;
        }
        /// <summary>Returns the AsyncEnumerator object that is being suspended/resumed.</summary>
        public AsyncEnumerator AsyncEnumerator { get { return m_asyncEnumerator; } }

        /// <summary>Arbitrary data that can be set when the AsyncEnumerator is suspending and retrieved when it is resuming.</summary>
        public Object State { get { return m_state; } set { m_state = value; } }
    }
}
